#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include "ui_login.h"
#include "forgotpwd.h"
#include "register.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Login; }
QT_END_NAMESPACE

class Login : public QWidget
{
    Q_OBJECT

public:
    Login(QWidget *parent = nullptr);
    ~Login();

private slots:
    void on_loginButton_clicked();
    void on_registerButton_clicked();
    void on_forgotPwdButton_clicked();
    void onForgotPwdClosed();
    void on_btn_refreshCaptcha_clicked();  // 新增：刷新验证码按钮点击事件

private:
    Ui::Login *ui;
    ForgotPwd *forgotPwdWidget = nullptr;
    Register *registerWidget = nullptr;
    int captchaResult;

    void generateCaptcha();
    bool verifyCaptcha(const QString& input);
};

#endif // LOGIN_H
